@use "styles/Radius.module.scss";
@use "styles/Spacings.module.scss";
@use "styles/Typography.module.scss";

%header_style {
  background-color: var(--background-2);
  padding-inline: Spacings.$spacing05;
  padding-block: Spacings.$spacing01;
  font-size: Typography.$small;
}

@mixin textColor($color) {
  color: var(--#{$color});
}

.current_brain_wrapper {
  @extend %header_style;
  @include textColor(text-1);

  .brain_infos {
    display: flex;
    justify-content: space-between;
    align-items: center;
    overflow: hidden;

    .left {
      display: flex;
      gap: Spacings.$spacing02;
      align-items: center;
      @include Typography.EllipsisOverflow;

      .title,
      .brain_name {
        white-space: nowrap;
      }

      .brain_name_wrapper {
        display: flex;
        gap: Spacings.$spacing02;
        align-items: center;
        overflow: hidden;

        .dark_image {
          filter: invert(100%);
        }

        .brain_image {
          border-radius: Radius.$normal;
        }

        .brain_name {
          @include textColor(text-3);
          @include Typography.EllipsisOverflow;

          &.new {
            color: var(--primary-0);
          }
        }

        .brain_snippet {
          min-width: 18px;
          min-height: 18px;
          max-width: 18px;
          max-height: 18px;
          border-radius: Radius.$normal;
          display: flex;
          justify-content: center;
          align-items: center;
          font-size: Typography.$very_tiny;
        }

        .warning {
          color: var(--warning);
          display: flex;
          align-items: center;
          gap: Spacings.$spacing02;
          margin-left: Spacings.$spacing02;
          font-size: Typography.$tiny;
        }
      }
    }
  }
}

.no_brain_selected,
.no_credits_left {
  @extend %header_style;
}

.no_credits_left {
  @include textColor(dangerous);
}
